<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link type="text/css" href="../../resource/ystfiles/wapcommon.css" rel="stylesheet">
    <style>
    	body{
    		
    	}
    </style>
</head>
<body>
  <header id="statusBar">
    <div class="header">
        <div class="return">
        	<img src="../../image/back.png" tapmode="presshover" style="left:0" onclick="toindex()" />
        </div>
        <div class="tittle">
    		用户类型
        </div>
    </div>
  </header>
	<div style="display: table;margin-top: 20px;padding-bottom: 20px;" id="main">
		 <div style="float:left;width:50%;text-align: center;padding-top: 20px;-webkit-tap-highlight-color: rgba(0,0,0,0);" tapmode="presshover" onclick="ptcz();">
		 <div><img style="width:40%" src="../../image/tabBar/clgl_ptcz.png"></div>
		 <div style="font-size: 16px;">普通车主</div>
		 </div>
		 <div style="float:left;width:50%;text-align: center;padding-top: 20px;-webkit-tap-highlight-color: rgba(0,0,0,0);" tapmode="presshover" onclick="fwry();">
		 <div><img style="width:40%" src="../../image/tabBar/clgl_fwry.png"></div>
		 <div style="font-size: 16px;">服务人员</div>
		 </div>
	</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../resource/jquery1.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../script/naes.js"></script>
<script type="text/javascript" src="../../script/constants.js"></script>
<script type="text/javascript">
	apiready = function(){
		 api.parseTapmode();
		 $api.fixStatusBar( $api.dom('header') );
	     if(api.systemType == "ios"){
	       document.getElementById("statusBar").style.background = "#298cb4";
	     }
	};
	
	function toindex(){
		api.closeWin();
	}
	function ptcz(){
		api.openWin({
	        name: '普通车主',
	        url: 'commonPerson.html'
        });
	}
	function fwry(){
		var dl_phone = $api.getStorage("dl_phone");
		if (typeof(dl_phone) == "undefined" || dl_phone == "undefined" || dl_phone == "" || dl_phone == null) {
		   api.alert({
					msg: '登录已过期，请重新登录！'
				}, function(ret, err) {
					api.openWin({
						name: '跳转登陆',
						url: '../login.html'
					});
				});
		}else{
			var callback=function(ret, err){
				if(ret){
					if(ret.success){
						if(ret.amount>0){
							api.openWin({
						        name: '服务人员',
						        url: 'servicePerson.html'
					        });
						}else{
							api.alert({msg:"对不起您无权操作服务人员模块！"});
						}
					}else{
						api.alert({msg:"载入错误！原因："+ret.msg});
					}
				}else{
					api.alert({msg:"载入错误！原因："+err.msg});
				}
			};
			var content = {"dl_phone":dl_phone};
			apiAjax(JSON.stringify(content),url.getServiceAuthority,callback);
		}
	}
</script>
</html>